﻿<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>珠峰社区</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <!-- basic styles -->
  <link href="/css/bootstrap.min.css" rel="stylesheet" />
  <link rel="stylesheet" href="/css/font-awesome.min.css" />
  <link rel="stylesheet" href="/css/community.css" />
  <!--[if lt IE 9]>
  <script src="/js/respond.min.js"></script>
  <![endif]-->
</head>

<body>
<% include ./include/header %>
<div class="main-container" id="main-container">
  <div class="main-container-inner">
    <a class="menu-toggler" id="menu-toggler" href="#"> <span class="menu-text"></span> </a>
    <div class="sidebar" id="sidebar">
      <ul class="nav nav-list">
        <li class="active"> <a href="/category/list/1/10"> <i class="icon-dashboard"></i> <span class="menu-text"> 栏目管理 </span> </a> </li>
        <li> <a href="/article/list/1/10"> <i class="icon-text-width"></i> <span class="menu-text"> 主题管理 </span> </a> </li>
      </ul>
      <!-- /.nav-list -->

      <div class="sidebar-collapse" id="sidebar-collapse">
        <i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
      </div>
    </div>
    <div class="main-content">
      <div class="breadcrumbs" id="breadcrumbs">

        <ul class="breadcrumb">
          <li> <i class="icon-home home-icon"></i> <a href="#">后台管理系统</a> </li>
          <li class="active">主题管理</li>
        </ul>


        <div class="nav-search" id="nav-search">
          <form class="form-search">
            <span class="input-icon">
            <input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
            <i class="icon-search nav-search-icon"></i> </span>
          </form>
        </div>

      </div>

      <div class="page-content" style="width: 100%;">
        <div class="row">
          <div class="col-sm-12 ">
            <div class="widget">

              <div class="widget-head">
                <div class="pull-left">文章列表</div>
                <div class="widget-icons pull-right">
                  <a class="btn btn-default"  href="/article/add">新增</a>
                  <a href="#" class="wclose"><i class="icon-remove"></i></a>
                </div>
                <div class="clearfix"></div>
              </div>

              <div class="widget-content" style="display: block;">

                <table class="table table-striped table-bordered table-hover ">
                  <thead>
                  <tr>
                    <th>主键</th>
                    <th>序号</th>
                    <th>是否推荐</th>
                    <th>文章标题</th>
                    <th>栏目</th>
                    <th>功能介绍</th>
                    <th>综合示例</th>
                    <th>面试题</th>
                    <th>创建者</th>
                    <th>操作</th>
                  </tr>
                  </thead>
                  <tbody>
                  <%
                  if(articles && articles.length>0){
                  for(var i=0;i<articles.length;i++){
                    var article = articles[i];
                  %>
                  <tr>
                    <td><%=article._id%></td>
                    <td><%=article.order_by%></td>
                    <td><%=article.is_recommend?'是':'否'%></td>
                    <td><%=article.articleTitle%></td>
                    <td><%=article.category_id?article.category_id.name:''%></td>
                    <td><%=article.functionDescription%></td>
                    <td><%=article.articleExamples%></td>
                    <td><%=article.jobInterview%></td>
                    <td><%=article.user_id?article.user_id.user_name:''%></td>
                    <td>
                      <a class="btn btn-default"  href="/article/view/<%=article._id%>">查看</a>
                      <a class="btn btn-default"  href="/article/edit/<%=article._id%>">修改</a>
                      <a class="btn btn-default"  href="/article/delete/<%=article._id%>">删除</a>
                    </td>
                  </tr>
                  <%
                  }
                  }
                  %>
                  </tbody>
                </table>

                <div class="widget-foot">


                  <ul class="pagination pull-right">
                    <%
                    var num;
                    if(pageNum%5==0)
                      num = pageNum/5 - 1;
                    else
                      num = Math.floor(pageNum/5);
                    var start = num*5+1;
                    var end = start+4>totalPage?totalPage:start+4;
                    if(start>1){
                    %> <li><a href="/article/list/<%=start-1%>/<%=pageSize%>">Prev</a></li><%
                    }
                    %>
                    <%
                    for(var i=start;i<=end;i++){
                    %>
                    <li><a href="/article/list/<%=i%>/<%=pageSize%>"><%
                        if(i == pageNum){
                        %><font color="red"><%=i%></font><%
                        }else{
                        %><%=i%><%
                        }
                        %></a></li>
                    <%
                    }
                    if(totalPage > end){
                    %><li><a href="/article/list/<%=end+1%>/<%=pageSize%>">Next</a></li><%
                    }
                    %>
                  </ul>

                  <div class="clearfix"></div>

                </div>

              </div>

            </div>

          </div>
        </div>

      </div>
    </div>


  </div>

</div>


</div>



</div>



<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> <i class="icon-double-angle-up icon-only bigger-110"></i> </a> </div>


<script src="/js/jquery-2.0.3.min.js"></script>

<script src="/js/bootstrap.min.js"></script>
<script src="/js/ace.js"></script>



</body>
</html>
